package top.v5it.japi.ddd.example.order.configuration;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.v5it.japi.ddd.example.order.event.OrderEventListener;

/**
 * @author zhanpu
 * @date 2023/11/17
 */
@Configuration
public class EventConfiguration {

    public static final String TOPIC_NAME = "example_order_event_topic";

    @Bean
    NewTopic newTopic() {
        return new NewTopic(TOPIC_NAME, 3, new Short("1"));
    }

    @Bean
    OrderEventListener orderListener() {
        return new OrderEventListener();
    }

}
